package com.moody.service;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.moody.hibernate.domain.OrgInfo;
import com.moody.hibernate.domain.RightInfo;
import com.moody.hibernate.domain.RoleInfo;
import com.moody.hibernate.domain.RoleRight;
import com.moody.hibernate.domain.UserInfo;
import com.moody.hibernate.domain.UserRole;

@Service
public interface SystemService {

	List<OrgInfo> findAllOrg();

	OrgInfo findOrgById(String orgId);

	void deleteOrgInfoById(String orgId);

	void insertOrg(OrgInfo org);

	void updateOrg(OrgInfo org);

	List<UserInfo> findAllUser();

	UserInfo findUserById(String userId);

	void deleteUserInfoById(String userId);

	void insertUser(UserInfo user);

	void updateUser(UserInfo user);

	List<RoleInfo> findAllRole();

	void insertRole(RoleInfo role);

	void updateRole(RoleInfo role);

	RoleInfo findRoleById(String roleId);

	void deleteRoleInfoById(String roleId);

	List<RightInfo> findAllRight();
	
	void insertRight(RightInfo role);

	void updateRight(RightInfo role);

	RightInfo findRightById(String roleId);

	void deleteRightInfoById(String roleId);

	List<RoleInfo> findRoleByUserId(String userId);

	void deleteUserRoleByUserId(String userId);

	void insertUserRole(List<UserRole> userRoleList);

	List<UserRole> findUserRoleByUserId(String userId);

	List<RightInfo> findRightByRoleId(String roleId);

	void deleteRoleRightByUserId(String roleId);

	List<RoleRight> findRoleRightByRoleId(String roleId);

	void insertRoleRight(List<RoleRight> roleRightList);

	UserInfo findLoginUser(String username, String password);

	List<UserInfo> findLoginUserByUserName(String username);
	
	boolean verifyUrlVisitRight(String url, String userId);

	List<UserInfo> findUserByIdOrUserName(String userId, String userName);

	List<UserInfo> findUserByCondition(Map<String, String> condition);
}
